import { Vue } from 'vue-property-decorator';

/**
 * 应用菜单基类
 */
export class ${srfclassname(ctrl.codeName)}Base extends Vue {

    /**
     * 获取应用上下文
     *
     * @memberof ${srfclassname(ctrl.codeName)}Base
     */
    get context(): any {
        return this.$appService.contextStore.appContext || {};
    }

    /**
     * 菜单点击
     *
     * @param {*} item 菜单数据
     * @memberof ${srfclassname(ctrl.codeName)}Base
     */
    public click(item: any) {
        if (item) {
            let judge = true;
            switch (item.appfunctag) {
                <#if ctrl.getPSAppFuncs()??>
                <#assign appFuncs = ctrl.getPSAppFuncs()>
                <#list appFuncs as singFuncs>
                case '${singFuncs.getCodeName()}': 
                    this.click${singFuncs.codeName}(item); break;
                </#list>
                </#if>
                default:
                    judge = false;
                    console.warn('未指定应用功能');
            }
            if (judge && this.$uiState.isStyle2()) {
                this.$appService.navHistory.reset();
                this.$appService.viewStore.reset();
            }
        }
    }
<#if ctrl.getPSAppFuncs()??>
<@ibizindent blank=4>
<#list ctrl.getPSAppFuncs() as singleFuncs>

${P.getLogicCode(singleFuncs,"LOGIC.vue").code}
</#list>
</@ibizindent>
</#if>

    /**
     * 绘制内容
     *
     * @private
     * @memberof ${srfclassname(ctrl.codeName)}Base
     */
    public render(): any {
        return <span style="display: none;"/>
    }

}